#pragma once
#include "..\nodes\Node.h"

namespace ds {

class Renderer;
class Layer;
class Material;
class RenderTarget;

enum RenderPass {
	RP_GEOMETRY , RP_ALPHA,RP_ORTHOGONAL
};

class RenderStage {

public:
	RenderStage(const std::string& name);
	~RenderStage();
	void addLayer(Layer layer);
	void addPass(RenderPass rp);
	void addTarget(RenderTarget* rt);
};

class IRenderStage {

public:
	IRenderStage() {}
	virtual ~IRenderStage() {}
	virtual void render(Renderer* renderer,List<Node*>& list,bool rtOnly) = 0;
	virtual void renderNode(Renderer* renderer,Node* node) = 0;
	virtual std::string getName() = 0;
};

class BaseRenderStage : public IRenderStage {

public:
	BaseRenderStage() {}
	virtual ~BaseRenderStage() {}
	void renderNode(Renderer* renderer,Node* node);
	std::string getName() { return "BaseRenderStage"; }
protected:
	//Material* m_Material;
};

class BackgroundRenderStage : public BaseRenderStage {

public:
	BackgroundRenderStage() {}
	virtual ~BackgroundRenderStage() {}
	void render(Renderer* renderer,List<Node*>& list,bool rtOnly);
	std::string getName() { return "BackgroundRenderStage"; }
};

class GeometryRenderStage : public BaseRenderStage {

public:
	GeometryRenderStage() {}
	virtual ~GeometryRenderStage() {}
	void render(Renderer* renderer,List<Node*>& list,bool rtOnly);
	std::string getName() { return "GeometryRenderStage"; }
};

class AlphaRenderStage : public BaseRenderStage {

public:
	AlphaRenderStage() {}
	virtual ~AlphaRenderStage() {}
	void render(Renderer* renderer,List<Node*>& list,bool rtOnly);
	std::string getName() { return "AlphaRenderStage"; }
};

class OrthogonalRenderStage : public BaseRenderStage {

public:
	OrthogonalRenderStage() {}
	virtual ~OrthogonalRenderStage() {}
	void render(Renderer* renderer,List<Node*>& list,bool rtOnly);
	std::string getName() { return "OrthogonalRenderStage"; }
};

};
